SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE dbo.DnnProduct_DeleteDesktopModule
	@DesktopModuleId int
AS
-- delete custom permissions
DELETE FROM dbo.DnnProduct_Permission
WHERE moduledefid in 
	(SELECT moduledefid 
	FROM dbo.DnnProduct_ModuleDefinitions
	WHERE desktopmoduleid = @DesktopModuleId)
	
DELETE FROM dbo.DnnProduct_DesktopModules 
WHERE DesktopModuleId = @DesktopModuleId

GO
